package com.jake.microservice.consumer.controller;

import com.jake.microservice.consumer.service.UserFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("feign/users")
public class UserFeignController {

    @Autowired
    private UserFeignService userFeignService;

    @GetMapping
    public String getUsers() {
        return userFeignService.getUsers();
    }

    @GetMapping("{uid}")
    public String getUserById(@PathVariable Integer uid) {
        return userFeignService.getUserById(uid);
    }
}
